package com.warm.base.design.c_factory.sample;


import com.warm.base.design.c_factory.ConcreteProductA1;
import com.warm.base.design.c_factory.ConcreteProductA2;
import com.warm.base.design.c_factory.ProductA;

/**
 * @Date: 2019/11/28 14:10
 * @Author: LChuang
 * @Description:
 */
public class SimpleFactory {

    public ProductA getProduct(String name){
        if(name.equals("a1")){
            return new ConcreteProductA1();
        }else {
            return new ConcreteProductA2();
        }
    }
}
